<?php
	session_start();
	mysql_connect("localhost", "sapmenet_admin", "a1s2d3f4g5h6j7") or die ("Problem with datebase");
	mysql_select_db("sapmenet_users");
	
	$not=mysql_query("SELECT id, IDsnimka, IDpub, text FROM notifications WHERE seen = 0 AND userID={$_SESSION['JID']} ORDER BY id desc");
	if(mysql_num_rows($not)>0)
	{
		while ($result=mysql_fetch_array($not, MYSQL_NUM))
		{
			if ($result[1]!=-1)
			{
				echo "<div class = 'singleNotificationTab'><div id=".$result[1].">".$result[3]."</div><img src='del.png' id=".$result[0]." class = 'deleteNotificationButton' title = 'Delete Notification'></div>";
			}
			if ($result[2]!=-1)
			{
				echo "<div class = 'singleNotificationTab'><div id=".$result[2].">".$result[3]."</div><img src='del.png' id=".$result[0]." class = 'deleteNotificationButton' title = 'Delete Notification'></div>";
			}
			if ($result[1]==-1 && $result[2]==-1)
			{
				echo "<div class = 'singleNotificationTab'>".$result[3]."<img src='del.png' id=".$result[0]." class = 'deleteNotificationButton' title = 'Delete Notification'></div>";
			}
		}	
	}
	else
	{
		echo("HUI");
	}
?>